package com.ibiaoke.order.service;



import com.ibiaoke.common.base.Page;
import com.ibiaoke.customer.entity.Customer;
import com.ibiaoke.customer.entity.PtOpenGroup;
import com.ibiaoke.customer.entity.ThirdPartLogin;
import com.ibiaoke.order.entity.PtOrder;
import com.ibiaoke.order.entity.so.SubmitOrderSO;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.util.List;

public interface PtOrderService {

    List<PtOrder> getPtOrder(PtOrder ptOrder, Page page, String isEcxel);

    List<PtOrder> getPtOrderDeatil(String ptOrderCode);

    /**
     * 开团，生成订单.生成pt_order和pt_open_group表数据
     */
    PtOrder submitPtGoodsOrder(Customer customer, Integer ptGoodsId, Integer addressId, Integer deliveryType, ThirdPartLogin thirdPartLogin, Integer shopId);

    /**
     * 拼团，生成订单.生成pt_order和pt_flight_group表数据
     *
     * @return
     */
    PtOrder submitPtGoodsFlightOrder(SubmitOrderSO submitOrderSO, Integer ptGoodsId);

    String generateOrderNo();

    /**
     * 查询我的订单
     */
    List<PtOrder> getMyPtOrder(Integer userId, Page page);

    /**
     * 确认收货改订单状态
     */
    Integer upPtOrderStatus(Integer orderId);

    /**
     * 删除订单，修改isdelete状态
     */
    Integer removePtOrder(Integer orderId);

    /**
     * 根据id查询拼团订单
     */
    PtOrder getPtOrderById(Integer orderId);

    //支付成功，更改订单状态
    Integer updateOrderStatus(PtOrder ptOrder);

    Integer upPtOrderTransaction(Integer orderId, String TransactionNo);

    //支付之前的校验
    void checkBeforPay(Integer orderId);

    //更改订单信息
    Integer UpdatePtOrder(PtOrder ptOrder);

    //72小时自动确认收货
    void automaticReceipt();

    //超时，拼团失败，更改订单状态和openGroup的状态
    void updateOverTimePtOrder();

    //取消订单改状态
    void updatePtOrderStatusByCancel(Integer orderId);

    //拼团订单号查询
    List<PtOrder> getPtOrderByCode(String ordercCode);

    //待付款状态，超过1小时，更改订单状态为已取消
    void updateWaitPayPtOrder();

    //更改delete状态
    Integer updateDelete(Integer orderId, Integer delete);

    //退款
    void PtPayRefund();

    PtOrder submitPtFlightOrder(SubmitOrderSO submitOrderSO, PtOpenGroup openGroup, Customer customer, ThirdPartLogin thirdPartLogin);

    //poi一键导出Excel表
    Integer getPtOrderByExcel(List<PtOrder> listOrder);

    //下载
    void downloadFile(HttpServletResponse response, boolean isDelete);

    //退款短信提示
    String sendMsgRefund(PtOrder ptOrder);

    String alipayRefundRequest(String out_trade_no, String trade_no, double refund_amount);

    Object refundPay(Integer orderId, String ptOrderCode, String transactionNo, double totalFee);
}

